<?php

hc_core_ClassLoader::load('substrate_IPlaceholderConfigurer');
hc_core_ClassLoader::load('hc_configuration_IConfiguration');
hc_core_ClassLoader::load('hc_configuration_ConfigurationUtil');

class substrate_ConfigurationInterfacePlaceholderConfigurer implements substrate_IPlaceholderConfigurer {

    protected $configuration;

    private $resolver;

    public function __construct(hc_configuration_IConfiguration $configuration) {
        $this->configuration = $configuration;
    }

    public function replacePlaceholders($value) {
        return hc_configuration_ConfigurationUtil::RESOLVE_VALUE(
            $this->configuration,
            $value
        );
    }

    protected function getResolver() {
        if ( $this->resolver === null ) {
            $this->resolver = new hc_configuration_Resolver($this);
        }
        return $this->resolver;
    }

}

?>
